import { RouteRecordRaw } from "vue-router"
import tabbar from '../components/tab-bar/index.vue'
import topbar from '../components/top-bar/index.vue'
const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/home'
    }, {
        path: '/home',
        name: 'HOME',
        components:{
            default:() => import ('../pages/home/index.vue'),
            footer:tabbar
        },
        meta:{
            title:'首页',
            isShowTopBar:false 
        }
    },{
        path: '/classify',
        name: 'CLASSIFY',
        components:{
            default:() => import ('../pages/classification/index.vue'),
            footer:tabbar
        },
        meta:{
            title:'商品分类',
            isShowTopBar:false 
        }
    },{
        path: '/community',
        name: 'COMMUNITY',
        components:{
            default:() => import ('../pages/community/index.vue'),
            footer:tabbar
        },
        meta:{
            title:'社区',
            isShowTopBar:false 
        }
    },{
        path: '/cart',
        name: 'CART',
        components:{
            default:() => import ('../pages/cart/index.vue'),
            footer:tabbar,
            header:topbar
        },
        meta:{
            title:'购物车',
            isShowTopBar:true,
            text:'管理' 
        }
    },{
        path: '/mine',
        name: 'MINE',
        components:{
            default:() => import ('../pages/mine/index.vue'),
            footer:tabbar
        },
        meta:{
            title:'个人中心',
            isShowTopBar:false 
        }
    },
    {
        path: '/details',
        name: 'DETAILS',
        components:{
            default:() => import ('../pages/details/index.vue'),
            header:topbar  
        },
        meta:{
            title:'商品详情',
            isShowTopBar:true,
            icon:''
        }
    },
    {
        path: '/search',
        name: 'SEARCH',
        components:{
            default:() => import ('../pages/search/index.vue'),
        },
        meta:{
            title:'商品搜索',
            isShowTopBar:false 
        }
    },
    {
        path:'/login',
        name:'LOGIN',
        components:{
            default:() => import ('@/pages/login/index.vue'),
            header:topbar 
        },
        meta:{
            title:'登录',
            isShowTopBar:true 
        }
    },
    {
        path:'/register',
        name:'REGISTER',
        components:{
            default:() => import ('@/pages/register/index.vue'),
            header:topbar 
        },
        meta:{
            title:'注册',
            isShowTopBar:true 
        }
    }
]

export default routes